package com.lonely.web.controller.purchase;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.lonely.common.core.domain.api.R;
import com.lonely.purchase.domain.dto.materialpurchase.DeductionReplenishDTO;
import com.lonely.purchase.service.IMaterialPurchaseDeductionReplenishService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : 黄志标
 * @date: 2025/7/23 15:21
 * @description: 物料采购扣减补货请求处理器
 */
@RestController
@RequestMapping("/purchaseManager/materialPurchaseDeductionReplenish")
@Api(tags = "采购管理/物料采购")
public class MaterialPurchaseDeductionReplenishController {

    @Autowired
    private IMaterialPurchaseDeductionReplenishService materialPurchaseDeductionReplenishService;

    /**
     * 扣减补料
     *
     * @param deductionReplenishDTO
     * @return
     */
    @PostMapping("/addDeductionReplenish")
    @SaCheckPermission("purchase:materialPurchase:addDeductionReplenish")
    public R<Boolean> addDeductionReplenish(@RequestBody @Validated DeductionReplenishDTO deductionReplenishDTO) {
        this.materialPurchaseDeductionReplenishService.addDeductionReplenish(deductionReplenishDTO);
        return R.status(true);
    }

}
